import {OTMixinBodyMethods} from "./OTMixinBodyMethods"
import {OTMixinColumnMethod} from "@/mixins/VTMixin/OTMixinColumnMethod";
import {OTMixinBodyFooter} from "@/mixins/VTMixin/OTMixinBodyFooter";

export const OTMixinBody = {
    name: 'OTMixinBody',
    mixins: [OTMixinBodyMethods,OTMixinColumnMethod, OTMixinBodyFooter],
    data() {
        return {
            components: undefined,
            customUrl: undefined,
            parameter: {},
            parameterDefault: {},
            orderByColumns: [],
            loading: {},
            deleteParameter: {},
            tableConfig: {},
            isMaximized: false,
            operationBtn: [],
            toolBtn: [],
            formItem: [],
            selectBox: "0",//0/无、1/单选、2/
            table: {
                sortable: false,
                scrollX: {enabled: true, gt: 5},
                scrollY: {enabled: true, gt: 5},
                ref: 'vTable',
                loading: false,
                border: false,
                align: 'center',
                size: "mini",
                height: 'auto',
                "show-footer": false,
                // 合并行字段
                mergeFields: [],
                loadingConfig: {
                    text: '数据加载中..'
                },
                formConfig: {
                    show: true,
                    size: "medium",
                    titleWidth: 100,
                    titleAlign: 'right',
                    titleOverflow: true,
                    items: [],
                    data: {},
                },
                columnConfig: {
                    resizable: true
                },
                rowConfig: {
                    isCurrent: true,
                },
                sortConfig: {
                    defaultSort: []
                },
                columns: [],
                columnSource: [],
                data: [],
                dataSource: [],
                toolbarConfig: {
                    slots: {
                        buttons: 'header_left',
                        tools: 'header_right'
                    }
                },
                ...this.$attrs
            },
            search: {
                show: false,
                queryBtn: true,
                resetBtn: true,
            },
            toolbar: {
                show: false,//是否显示
                addBtn: true,//添加按钮
                batchDeleteBtn: true,//查询按钮
                uploadBtn: true,//上传按钮
                downloadBtn: true,//下载按钮
                refresh: true, // 显示刷新按钮
                import: true, // 显示导入按钮
                export: true, // 显示导出按钮
                print: true, // 显示打印按钮
                zoom: true, // 显示全屏按钮
                custom: true // 显示自定义列按钮
            },
            formMainList: [],
            dialog: {
                title: '弹窗',
                width: '80%',
                height: '',
                form: [],
                designer: '0'
            },
            formKey: 0,
            dialogVisible: false,
            events: {},
        }
    },
    computed: {
        $table() {
            return this.$refs[this.table.ref]
        }
    },
}
